
<div class="x-body">

    <xblock>
        <!--<button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button>-->
        <button class="layui-btn" ><ob_link><a  href="{:url('applicationmembercardAdd',array('id' => 0))}" style="color: white"> 新 增</a></ob_link></button>

    </xblock>
    <table class="layui-table x-admin">
        <thead>
        <tr>

            <th>序号</th>

            <th>应用名称</th>
            <th>会员卡名称</th>

            <th>描述</th>
            <th>有效期</th>
            <th>级别</th>
            <th>官方价</th>
            <th>现价</th>
            <th>状态</th>
            <th>创建时间</th>
            <th>更新时间</th>
            <th>操作</th>
        </thead>
        {notempty name='list'}
        <tbody>
        {volist name='list' id='vo' key="k"}
        <tr>

            <td>{$k}</td>
            <td>
                <div><span>{$vo.app_name}</span></div>


            </td>
            <td>
                <div><span>{$vo.name}</span></div>

            </td>
            <td>
                <div><span>{$vo.describer}</span></div>


            </td>

            <td>{eq name="vo.type" value="1"}
                年卡
                {else/}
                {eq name="vo.type" value="2"}
                季卡
                {else/}
                {eq name="vo.type" value="3"}
                月卡
                {else/}
                周卡
                {/eq}
                {/eq}
                钻石会员
                {/eq}</td>


            <td>{eq name="vo.level" value="1"}
                普通会员
                {else/}
                超级会员
                {/eq}</td>

            <td>
                <div><span>{$vo.official_price}</span></div>


            </td>
            <td>
                <div><span>{$vo.real_price}</span></div>


            </td>
            <td><ob_link><a class=" " href="{:url('applicationMembercardSetStatus', array('id' => $vo['id'], 'status' => (int)!$vo['status']))}">{if condition="$vo.status eq 1"} 开启{else/}关闭{/if}</a></ob_link></td>
            <td>
                <div><span>{$vo.create_time|date='Y-m-d H:i:s',###}</span></div>


            </td>
            <td>
                <div><span>{$vo.update_time|date='Y-m-d H:i:s',###}</span></div>


            </td>


            <td class="td-manage">
                <!--<a onclick="member_stop(this,'10001')" href="javascript:;"  title="启用">-->
                <!--<i class="layui-icon">&#xe601;</i>-->
                <!--</a>-->
                <ob_link><a title="编辑"  href="{:url('applicationmembercardAdd', array('id' => $vo['id']))}" >
                    <i class="layui-icon">&#xe642;</i>
                </a></ob_link>
                <ob_link><a title="删除" class="ajax-get"  href="{:url('applicationMembercardSetStatus', array('ids' => $vo['id'], 'status' => -1))}" >
                    <i class="layui-icon">&#xe640;</i>
                </a></ob_link>

            </td>
        </tr>
        {/volist}
        {else/}
        <tbody><tr class="odd"><td colspan="12" class="text-center" valign="top">{:config('empty_list_describe')}</td></tr></tbody>
        {/notempty}

        </tbody>
    </table>


</div>
<script>
    layui.use('form', function(){
        form = layui.form;

    });
    function delAll (argument) {

        var data = tableCheck.getData();


        layer.confirm('确认要删除吗？',function(index){
            //捉到所有被选中的，发异步进行删除
            //监听提交
            var url="{:url('setStatus')}";
            $.post(url,{ids:data,status:-1},function (d) {
                if(d.code==1){
                    $(".layui-form-checked").not('.header').parents('tr').remove();
                    layer.msg('删除成功', {icon: 1});

                }else{
                    layer.msg(d.msg);

                }
            },'json');



        });
    }
</script>

</body>

</html>


